package top.buluoluo.ordersservice.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.buluoluo.commoncore.domain.response.Result;
import top.buluoluo.ordersservice.client.ProductServiceClient;

@RestController
@RequestMapping("/test")
@Tag(name = "测试接口", description = "测试服务间通讯接口")
public class TestController {

    @Autowired
    private ProductServiceClient productServiceClient;

    @GetMapping("/checkDiscountValid/{discountId}")
    public Result<Boolean> checkDiscountValid(@PathVariable Long discountId){
        // 获取所有服务实例
        return productServiceClient.checkDiscountValid(discountId);
    }
}